import java.util.Scanner;

public class UserLogin {
    public static void main(String[] args) {
        /*1.new用户
         2接受输入
         3循环判断是否相等
         */

        User user=new User("stw","123456");
        for (int i = 0; i <= 3; i++) {
            System.out.println("亲输入用户名");
            Scanner scanner = new Scanner(System.in);
            String name = scanner.nextLine();
            System.out.println("亲输入密码");
            String password = scanner.nextLine();
            if (name.equals(user.getName()) && password.equals(user.getPassword())) {
                System.out.println("登录陈宫");
                GuessGame.start();
                break;
            }
            else {
                if (i<3){
                    System.out.println("你还有"+(3-i)+"次机会");
                }else {
                    System.out.println("账号被锁定");
                }
            }
        }
    }
}
